FROM python:3.9-slim

WORKDIR /app
COPY dist/simple-0.1.tar.gz .
COPY requirements.txt .

RUN pip install simple-0.1.tar.gz
# --no-cache-dir 不缓存
RUN pip install --no-cache-dir -r requirements.txt

# 设置环境变量
ENV FLASK_APP=server.py
ENV FLASK_ENV=production

EXPOSE 5000

# 生产使用gunicorn启动Flask应用
# CMD ["gunicorn", "--bind", "0.0.0.0:5000", "server:app"]
CMD ["python", "-m", "simple.run"] 